<!--conf
<sample>
              <product version="2.0" edition="pro"/>
                     <modifications>
					 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Markers</title>
	
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
</head>

<body>
	
	<h1>Markers</h1>
	<p>Markers functionality allows to select individual cells. You can also select several cells by shift-click and ctrl-click.</p>
	<table>
		<tr><td>
			<div id="gridbox" style="width:400px;height:270px;background-color:white;overflow:hidden;"></div>
		</td>
		<td style="padding-left:25" valign="top">
			<div id="logarea" style="background-color:lightgrey;height:270px;width:250px;overflow:auto; padding:3px;"></div>
		</td></tr>
		<tr><td>
			<a href="javascript:void(0)" onclick="mygrid.unmarkAll()">unmark all</a>
		
		</td>
		<td style="padding-left:25" valign="top">
			<a href="javascript:void(0)" onclick="mark()">get marked cells</a>
		</td></tr>
	</table>
	<br>
<script>

	mygrid = new dhtmlXGridObject('gridbox');
	mygrid.setImagePath("../../../codebase/imgs/");
	mygrid.setHeader("Sales,Book Title,Author");
	mygrid.setInitWidths("100,250,100")
	mygrid.setColAlign("right,left,left")
	mygrid.setColTypes("ro,ed,ed");
	mygrid.setColSorting("int,str,str")
	mygrid.enableMarkedCells();
	mygrid.init();
	mygrid.setSkin("dhx_skyblue");
	mygrid.loadXML("../common/grid_16_rows_columns_manipulations.xml");
	
	function mark(){
		var markedArray = mygrid.getMarked();
		document.getElementById("logarea").innerHTML += "All marked cells:<br/>["
		for(var i = 0; i < markedArray.length; i++){
			document.getElementById("logarea").innerHTML += "{ "+markedArray[i].toString()+" }"; 
		}
		document.getElementById("logarea").innerHTML += "]<br/>"
	}
	function doLog(str){
		
		var log = document.getElementById("logarea");
		log.innerHTML = log.innerHTML+str+"</br>"
		log.scrollTop = log.scrollHeight;
	}
	
</script>

</body>
</html>
